home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et3_0-a1.lha / et3 / src / View.h < prev    next >
C/C++ Source or Header  |  1992-07-02  |  3KB  |  100 lines

  1. #ifndef View_First
  2. #ifdef __GNUG__
  3. //pragma once
  4. #pragma interface
  5. #endif
  6. #define View_First
  7.  
  8. #include "VObject.h"
  9. #include "Symbol.h"
  10.  
  11. class SeqCollection;;
  12. class EvtHandler;
  13. class Clipper;
  14. class Document;
  15. class Data;
  16. class Menu;
  17.  
  18. extern bool gPrinting;
  19.  
  20. enum ViewFlags {
  21.     eViewNoPrint=   BIT(eVObjLast+1),
  22.     eViewLast   =   eVObjLast + 1
  23. };
  24.  
  25. enum ViewSizeDet {
  26.     eViewHFit   = BIT(0),
  27.     eViewVFit   = BIT(1),
  28.     eViewDefault= 0
  29. };
  30.  
  31. class View: public VObject {
  32. protected:
  33.     SeqCollection *clippers;
  34.     EvtHandler *nexthandler;
  35.     Clipper *focus;
  36. public:
  37.     MetaDef(View);
  38.     
  39.     View(EvtHandler *eh, Rectangle itsExtent, int id= -1);
  40.     ~View();
  41.     
  42.     void SetExtent(Point);
  43.     SeqCollection *GetClipperList()
  44.     { return clippers; }
  45.     void CheckOpen();
  46.     void Open(bool mode);
  47.     EvtHandler *GetNextHandler();
  48.     void SetNextHandler(EvtHandler *);
  49.     Document *GetDocument();
  50.     Rectangle GetViewedRect();
  51.     void ExtentChanged(VObject *what);
  52.     
  53.     //---- Drawing ---------------------------------
  54.     void DrawAll(Rectangle, bool);
  55.     void InvalidateRect(Rectangle);
  56.     
  57.     virtual void ShowInAllClippers(VoidObjMemberFunc, Object *op,
  58.                 void* =0, void* =0, void* =0, void* =0); 
  59.                 // obsolete
  60.     virtual void Update();
  61.     
  62.     //---- Printing ---------------------------------
  63.     virtual Rectangle NextPageBreak(int page, Rectangle pr);
  64.     virtual void PrintAdorn(Rectangle, int);
  65.     void DoObserve(int i, int c, void *v, Object *op);
  66.     
  67.     //---- Selection --------------------------------
  68.     virtual void ShowSelection(bool redraw= TRUE, bool show= TRUE);
  69.     void HideSelection(bool redraw= TRUE)
  70.     { ShowSelection(redraw, FALSE); }
  71.     virtual void ClearSelection(bool redraw= TRUE);
  72.     
  73.     //---- Scrolling --------------------------------
  74.     void SetContainer(VObject *v);
  75.     void ClearContainer(VObject *v);
  76.     virtual void ConstrainScroll(Point*);
  77.     void RevealRect(Rectangle r, Point e);
  78.     void RevealAlign(Rectangle, VObjAlign al= (VObjAlign)(eVObjHLeft+eVObjVTop));
  79.     void Scroll(int mode, Point scroll, bool redraw= TRUE);
  80.     
  81.     //---- Clipboard --------------------------------
  82.     virtual bool CanPaste(Data *data);
  83.     virtual Command *PasteData(Data*);
  84.     virtual bool HasSelection();
  85.     
  86.     //---- Menu related methods ---------------------
  87.     Command *DoMenuCommand(int cmd);
  88.     void DoSetupMenu(Menu*);
  89.  
  90.     //---- Events -----------------------------------
  91.     Command *Input(Point lp, Token &t, Clipper *cl);
  92.     Command *DoCursorKeyCommand(EvtCursorDir, Token);
  93.     Command *DoFunctionKeyCommand(int, Token);
  94.     
  95.     //---- Inspecting -------------------------------
  96.     void InspectorId(char *buf, int sz);
  97. };
  98.  
  99. #endif
  100.